<!DOCTYPE html>
<!--stop信息管理-->
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="/static/js/common.js"></script>

</head>

<body>
    <div id="app" v-cloak class="popupW100">
        <el-form label-position="right" :model="Form" status-icon :rules="rules" ref="ruleForm" label-width="100px"
            size="mini">

            <el-row>
                <el-row>
                    <el-col :span="11">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{STOPInformationManagement.evaluation+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.evaluation" slot="suffix"
                                        :placeholder="STOPInformationManagement.evaluation">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in evaluation" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="11" :offset="2">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini" v-model="Form.observePeople">
                                    <template slot="prepend">
                                        {{STOPInformationManagement.observePeople+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col :span="11">
                        <div class="elst-select-mini">
                            <el-form-item>
                                <el-input size="mini">
                                    <template slot="prepend">
                                        <div>{{STOPInformationManagement.department+mark.m}}</div>
                                    </template>
                                    <el-select @visible-change="visibleChange" v-model="Form.department" slot="suffix"
                                        :placeholder="STOPInformationManagement.department">
                                        <el-option label="请选择" value=""></el-option>
                                        <el-option v-for="item in department" :label="item.value" :value="item.key">
                                        </el-option>
                                    </el-select>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>

                    <el-col :span="11" offset="2">
                        <el-form-item>
                            <div class="elst-select-mini" style="margin-left: -100px">
                                <el-input size="mini">
                                    <template slot="prepend">
                                        {{STOPInformationManagement.observaDate+mark.m}}
                                    </template>
                                    <el-date-picker slot="suffix" v-model="Form.observaDate" type="date" size="mini"
                                        format="yyyy-MM-dd" value-format="yyyy-MM-dd" placeholder="选择时间">
                                    </el-date-picker>
                                </el-input>
                            </div>
                        </el-form-item>
                    </el-col>
                </el-row>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini" v-model="Form.observation">
                                <template slot="prepend">
                                    {{STOPInformationManagement.observation+mark.m}}
                                </template>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11" offset="2">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    <div>{{STOPInformationManagement.shifts+mark.m}}</div>
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.shifts" slot="suffix"
                                    :placeholder="STOPInformationManagement.shifts">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in shifts" :label="item.value" :value="item.key">
                                    </el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
                <el-col :span="11">
                    <div class="elst-select-mini">
                        <el-form-item>
                            <el-input size="mini">
                                <template slot="prepend">
                                    <div>{{STOPInformationManagement.situation+mark.m}}</div>
                                </template>
                                <el-select @visible-change="visibleChange" v-model="Form.situation" slot="suffix"
                                    :placeholder="STOPInformationManagement.situation">
                                    <el-option label="请选择" value=""></el-option>
                                    <el-option v-for="item in situation" :label="item.value" :value="item.key">
                                    </el-option>
                                </el-select>
                            </el-input>
                        </el-form-item>
                    </div>
                </el-col>
            </el-row>
            <table style="width:100%" cellpadding="0" cellspacing="0">



                <!--人员反应-->
                <el-row>
                    <el-col span="24">
                        <label>{{STOPInformationManagement.response+mark.m}}</label>
                        <el-button type="primary" @click="responseInput('tj')">{{col.btnAdd}}</el-button>
                    </el-col>
                </el-row>
                <br>
                <el-row>
                    <el-col span="24">
                        <el-table :data="Form.response" border>
                            <el-table-column :label="STOPInformationManagement.responseMain">
                                <template slot-scope="scope">
                                    <el-input type="text" v-model="scope.row.responseMain" autocomplete="off"
                                        size="mini">
                                        {{scope.row.inspectMain}}
                                    </el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作">
                                <template slot-scope="scope">
                                    <el-button @click.native.prevent="deleteRow(scope.$index, Form.response)"
                                        type="text" size="small">
                                        移除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>


                <!--个人防护装备从头到脚检查-->
                <br>
                <el-row>
                    <el-col span="24">
                        <label>{{STOPInformationManagement.inspect+mark.m}}</label>
                        <el-button type="primary" @click="inspectInput('tj')">{{col.btnAdd}}</el-button>
                    </el-col>
                </el-row>
                <br>
                <el-row>
                    <el-col span="24">
                        <el-table :data="Form.inspect" border>
                            <el-table-column :label="STOPInformationManagement.inspectMain">
                                <template slot-scope="scope">
                                    <el-input type="text" v-model="scope.row.inspectMain" autocomplete="off"
                                        size="mini">
                                        {{scope.row.inspectMain}}
                                    </el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作">
                                <template slot-scope="scope">
                                    <el-button @click.native.prevent="deleteRow(scope.$index, Form.inspect)" type="text"
                                        size="small">
                                        移除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>


                <!--人员的位置伤害的原因-->
                <br>
                <el-row>
                    <el-col span="24">
                        <label>{{STOPInformationManagement.Causes+mark.m}}</label>
                        <el-button type="primary" @click="CausesInput('tj')">{{col.btnAdd}}</el-button>
                    </el-col>
                </el-row>
                <br>
                <el-row>
                    <el-col span="24">
                        <el-table :data="Form.Causes" border>
                            <el-table-column :label="STOPInformationManagement.CausesMain">
                                <template slot-scope="scope">
                                    <el-input type="text" v-model="scope.row.CausesMain" autocomplete="off" size="mini">
                                        {{scope.row.inspectMain}}
                                    </el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作">
                                <template slot-scope="scope">
                                    <el-button @click.native.prevent="deleteRow(scope.$index, Form.Causes)" type="text"
                                        size="small">
                                        移除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>

                <!--工具及设备-->
                <br>
                <el-row>
                    <el-col span="24">
                        <label>{{STOPInformationManagement.tool+mark.m}}</label>
                        <el-button type="primary" @click="toolInput('tj')">{{col.btnAdd}}</el-button>
                    </el-col>
                    <br>
                </el-row>
                <br>
                <el-row>
                    <el-col span="24">
                        <el-table :data="Form.tool" border>
                            <el-table-column :label="STOPInformationManagement.toolMain">
                                <template slot-scope="scope">
                                    <el-input type="text" v-model="scope.row.toolMain" autocomplete="off" size="mini">
                                        {{scope.row.inspectMain}}
                                    </el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作">
                                <template slot-scope="scope">
                                    <el-button @click.native.prevent="deleteRow(scope.$index, Form.tool)" type="text"
                                        size="small">
                                        移除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>



                <!--程序-->
                <br>
                <el-row>
                    <el-col span="24">
                        <label>{{STOPInformationManagement.program+mark.m}}</label>
                        <el-button type="primary" @click="programInput('tj')">{{col.btnAdd}}</el-button>
                    </el-col>
                </el-row>
                <br>
                <el-row>
                    <el-col span="24">
                        <el-table :data="Form.program" border>
                            <el-table-column :label="STOPInformationManagement.programMain">
                                <template slot-scope="scope">
                                    <el-input type="text" v-model="scope.row.programMain" autocomplete="off"
                                        size="mini">
                                        {{scope.row.inspectMain}}
                                    </el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作">
                                <template slot-scope="scope">
                                    <el-button @click.native.prevent="deleteRow(scope.$index, Form.program)" type="text"
                                        size="small">
                                        移除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>

                <!--秩序标准-->
                <br>
                <el-row>
                    <el-col span="24">
                        <label>{{STOPInformationManagement.standard+mark.m}}</label>
                        <el-button type="primary" @click="standardInput('tj')">{{col.btnAdd}}</el-button>
                    </el-col>
                </el-row>
                <br>
                <el-row>
                    <el-col span="24">
                        <el-table :data="Form.standard" border>
                            <el-table-column :label="STOPInformationManagement.standardMain">
                                <template slot-scope="scope">
                                    <el-input type="text" v-model="scope.row.standardMain" autocomplete="off"
                                        size="mini">
                                        {{scope.row.inspectMain}}
                                    </el-input>
                                </template>
                            </el-table-column>
                            <el-table-column label="操作">
                                <template slot-scope="scope">
                                    <el-button @click.native.prevent="deleteRow(scope.$index, Form.standard)"
                                        type="text" size="small">
                                        移除
                                    </el-button>
                                </template>
                            </el-table-column>
                        </el-table>
                    </el-col>
                </el-row>
                <br>
                <el-row>
                    <el-col>
                        <div class="elst-select-mini">
                            <label class="el-form-item__label"
                                style="width: auto!important;">{{STOPInformationManagement.encourage}}:</label>
                            <el-form-item>
                                <el-input size="mini" v-model="Form.encourage" type="textarea">
                                    <template slot="prepend">
                                        {{STOPInformationManagement.encourage+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                    <el-col>
                        <div class="elst-select-mini">
                            <label class="el-form-item__label"
                                style="width: auto!important;">{{STOPInformationManagement.correct}}:</label>
                            <el-form-item>
                                <el-input size="mini" v-model="Form.correct" type="textarea">
                                    <template slot="prepend">
                                        {{STOPInformationManagement.correct+mark.m}}
                                    </template>
                                </el-input>
                            </el-form-item>
                        </div>
                    </el-col>
                </el-row>

                <el-row type="flex" justify="end">
                    <el-form-item style="text-align:center; padding-top:5px">
                        <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnSave}}</el-button>
                        <el-button type="primary" @click="onSubmitForm('ruleForm')">{{col.btnCommit}}</el-button>
                        <el-button type="primary" @click="parent.ListItem.dialogVisible=false">{{col.btnBack}}
                        </el-button>
                    </el-form-item>
                </el-row>
        </el-form>
        <el-dialog title="" :visible.sync="ListItem.dialogVisible" width="90%" height="95%" top="10vh">
            <iframe ref="iframe" :src="ListItem.InputUrl" style="height:95%;width:100%" frameborder="0"></iframe>
        </el-dialog>
    </div>
    <script type="text/javascript">
        app = new Vue({
            el: '#app',
            data: {
                id: '',
                Form: {
                    id: guidEmpty,
                    evaluation: '', //"所有皆安全",
                    observePeople: '', // "观察人",
                    department: '', // "部门",
                    situation: '', //"区域",
                    encourage: '',//观察到的安全行为；为鼓励持续的安全表现所采取的行动
                    correct: '',//观察到的不安全行为；立即采取的纠正措施；预防再次发生采取的措施
                    response: '',// "人员反应",
                    inspect: '',// "个人防护装备从头到脚检查",
                    Causes: '',// "人员的位置伤害的原因",
                    tool: '',// "工具及设备",
                    program: '',// "程序",
                    standard: '',//,  "秩序标准",
                    shifts: ''
                },
                evaluation: [],
                observePeople: [],
                situation: [],
                department: [],
                shifts: [],
                rules: {},
                ListItem: ListItem,
            },
            methods: {
                //解決edge下select bug
                visibleChange: function (isVisible) {
                    visibleChange(isVisible)
                },
                handleNodeClick: function (data) {
                    console.log(data);
                },
                handleSelect: function (ev) {
                    console.log(ev);
                },
                handleChecked: function (value) {
                },
                handleCheckedConfirmation: function (value) {
                },
                deleteRow: function (index, rows) {
                    rows.splice(index, 1);
                },
                getData: function () {
                    getDataAdd(this, '/api/STOPInformationManagement/get?id=' + this.id);
                    getData(this, '/api/STOPInformationManagement/get?id=' + this.id);
                },
                programInput: function (val, id) { DialogShow(this, val, "programInput.html", id); },
                toolInput: function (val, id) { DialogShow(this, val, "toolInput.html", id); },
                CausesInput: function (val, id) { DialogShow(this, val, "CausesInput.html", id); },
                responseInput: function (val, id) { DialogShow(this, val, "responseInput.html", id); },
                inspectInput: function (val, id) { DialogShow(this, val, "inspectInput.html", id); },

                standardInput: function (val, id) { DialogShow(this, val, "standardInput.html", id); },
                //提交数据
                onSubmitForm: function (formName) {
                    var mythis = this;
                    onSubmitForm(this, '/api/STOPInformationManagement/Save', mythis.Form);
                },
            },
            mounted: function () {
                var list = getDicDataArray(['14', '03', '50', '12', '09', '08', '97', '120', '121', '122']);
                this.evaluation = getDicData('50');//所有皆安全
                this.observePeople = getDicDatafromArray('14', list);//观察人
                this.department = getDicData('n69');//部门
                this.shifts = getDicData('n68');//部门
                this.observaDate = Mock.Random.date();//观察日期
                this.situation = getDicData('n69');//区域
                this.id = getUrlParam("id");
                this.getData();
            }
        });
    </script>
</body>

</html>